/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.ampathhousehold.service.impl;

import java.util.List;

import org.openmrs.api.impl.BaseOpenmrsService;
import org.openmrs.module.ampathhousehold.dao.HouseholdDAO;
import org.openmrs.module.ampathhousehold.model.Household;
import org.openmrs.module.ampathhousehold.service.HouseholdService;
/**
 *
 */
public class HouseholdServiceImpl extends BaseOpenmrsService implements HouseholdService {
	
	private HouseholdDAO householdDAO;
	
	/**
	 * Set the householdDAO with the householdDAO value
	 * 
	 * @param householdDAO the householdDAO to set
	 */
	public void setHouseholdDAO(HouseholdDAO householdDAO) {
		this.householdDAO = householdDAO;
	}
	
	/**
	 * @see org.openmrs.module.ampathhousehold.service.HouseholdService#getHouseholdByHouseholdId(java.lang.Integer)
	 */
	@Override
	public Household getHouseholdByHouseholdId(Integer id) {
		return householdDAO.getHousehold(id);
	}
	
	/**
	 * @see org.openmrs.module.ampathhousehold.service.HouseholdService#getHouseholdByVillage(java.lang.String)
	 */
	@Override
	public List<Household> getHouseholdByVillage(String village) {
		return householdDAO.getHouseholds(village);
	}
	
	/**
	 * @see org.openmrs.module.ampathhousehold.service.HouseholdService#saveHousehold(org.openmrs.module.ampathhousehold.model.Household)
	 */
	@Override
	public Household saveHousehold(Household household) {
		return householdDAO.saveHousehold(household);
	}
	
}
